#ifndef _INFINITE_SERVER_HPP_
#define _INFINITE_SERVER_HPP_

#include "queue.hpp"
#include "time_providers.hpp"
#include <iostream>
using namespace std;

class InfiniteServer : public Queue {
public:
  InfiniteServer(TP *time_provider, rng01_t &r, string name)
    : Queue(time_provider, r, name) {}

  virtual void departure(Job *leaving, double t) {
    update_accumulators(t);
    --n_jobs;
    last_event_time = t;
    //update indexes
    throughput = (double)++n_departures / t;
    waiting_time = area / n_departures;
  }

  virtual void arrival(Job *job, double t = 0) {
    update_accumulators(t);
    ++n_jobs;
    last_event_time = t;
    schedule_departure(job);
  }
};
#endif
